import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import LoginForm from "../views/login/LoginForm.vue"
import RegisterForm from "../views/login/RegisterForm.vue"
import HomePage from "../views/homePage/HomePage.vue"
import PracticeBase from "@/views/practice/PracticeBase.vue";
import PracticeIntroductionFather from "@/views/practice/PracticeIntroductionFather.vue";
import ChartStatistics from "@/views/charts/ChartStatistics.vue";
import PersonalCenter from "@/views/personalCenter/PersonalCenter.vue";
import ProcessMaintenance from "@/views/basicDataManagement/ProcessMaintenance.vue";
import HeroMaintenance from "@/views/basicDataManagement/HeroMaintenance.vue";
import PersonnelMaintenance from "@/views/basicDataManagement/PersonnelMaintenance.vue";
import MyToDoList from "@/views/todoList/MyToDoList.vue";
import MainPage from "@/views/homePage/MainPage.vue";
import NotificationAnnouncement from "@/views/systemManagement/NotificationAnnouncement.vue";
import ScrollingTable from "@/views/practice/ScrollingTable.vue";
import TreeControl from "@/views/controlTesting/TreeControl.vue";
import VideoPlayerControl from "@/views/controlTesting/VideoPlayerControl.vue"
import RichTextControl from "@/views/controlTesting/RichTextControl.vue"
import TabsControl from "@/views/controlTesting/TabsControl.vue"

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/Login',
    }, {
        path: '/Login',
        name: 'Login',
        component: LoginForm,
    }, {
        path: '/HomePage',
        redirect: '/HomePage/MainPage',
    }, {
        path: '/Login',
        name: 'Login',
        component: LoginForm,
    }, {
        path: '/Register',
        name: 'Register',
        component: RegisterForm,
    }, {
        path: '/HomePage',
        name: 'HomePage',
        component: HomePage,
        children: [
            {
                path: 'PracticeBase',
                name: 'PracticeBase',
                component: PracticeBase,
            }, {
                path: 'PracticeIntroductionFather',
                name: 'PracticeIntroductionFather',
                component: PracticeIntroductionFather,
            }, {
                path: 'PersonalCenter',
                name: 'PersonalCenter',
                component: PersonalCenter,
            }, {
                path: 'ChartStatistics',
                name: 'ChartStatistics',
                component: ChartStatistics,
            }, {
                path: '/basicDataManagement/ProcessMaintenance',
                name: 'ProcessMaintenance',
                component: ProcessMaintenance,
            }, {
                path: '/Practice/MyToDoList',
                name: 'MyToDoList',
                component: MyToDoList,
            }, {
                path: 'MainPage',
                name: 'MainPage',
                component: MainPage,
            }, {
                path: '/systemManagement/NotificationAnnouncement',
                name: 'NotificationAnnouncement',
                component: NotificationAnnouncement,
            }, {
                path: '/systemManagement/HeroMaintenance',
                name: 'HeroMaintenance',
                component: HeroMaintenance,
            },{
                path: '/systemManagement/PersonnelMaintenance',
                name: 'PersonnelMaintenance',
                component: PersonnelMaintenance,
            }, {
                path: '/Practice/ScrollingTable',
                name: 'ScrollingTable',
                component: ScrollingTable,
            }, {
                path: '/controlTesting/TreeControl',
                name: 'TreeControl',
                component: TreeControl,
            }, {
                path: '/controlTesting/VideoPlayerControl',
                name: 'VideoPlayerControl',
                component: VideoPlayerControl,
            }, {
                path: '/controlTesting/RichTextControl',
                name: 'RichTextControl',
                component: RichTextControl,
            }, {
                path: '/controlTesting/TabsControl',
                name: 'TabsControl',
                component: TabsControl,
            },
        ]
    }
];

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router